import request from '../utils/request';

export const fetchData = query => {
    return request({
        url: './table.json',
        method: 'get',
        params: query
    });
};
// 查找所有班主任
export const allHeadmaster = () => {
    return request({
        url: '/FindAllManager',
        method: 'get',
        // params: query
    })
}
//查找所有班级
export const allclassname = () => {
    return request({
        url: '/FindClassBystatus',
        method: 'get',
        // params: query
    })
}
// 添加班级
export const addClass = query => {
    return request({
        url: '/AddClass',
        method: 'post',
        params: query
    })
}


/**
 * 班级记录的查询条数
 */
export const countClass = query => {
    return request({
        url: '/CountClass',
        method: 'post',
        params: query
    })
}
/**
 * 查找班级(多个)
 * 根据条件（classname、headmater、name）
 */
export const findClass = query => {
    return request({
        url: '/FindClass',
        method: 'post',
        params: query
    })
}
/**
 * 查找班级
 * 通过（name,classname）
 */
export const findClassByTwo = query => {
    return request({
        url: '/FindclassBytwo',
        method: 'post',
        params: query
    })
}


/**
 * 修改班级信息
 */
export const updateClass = query => {
    return request({
        url: '/UpdateClass',
        method: 'post',
        params: query
    })
}



/**
 * 往届学员的去向信息(query包含分页的数据)
 */
export const oldstuinfo = query => {
    return request({
        url: '/LimitGraduation',
        method: 'post',
        params: query
    })
}
/**
 *往届学员的去向信息的条数
 */
export const countoldstuinfo = () => {
    return request({
        url: '/CountGraduation',
        method: 'get',
    })
}

/**
 * 通过query查询往届学员的去向信息
 */
export const oldstuinfobyquery = query => {
    return request({
        url: '/FindGraduationBytwo',
        method: 'post',
        params: query
    })
}
/**
 * 通过query查询往届学员的去向信息的条数
 */
export const countoldstuinfobyquery = query => {
    return request({
        url: '/CountGraduationBytwo',
        method: 'post',
        params: query
    })
}


/**
 * 统计所有管理员的数目
 */
export const countmanager = () => {
    return request({
        url: '/CountAllAdmin',
        method: 'get',
    })
}
/**
 * 查询当前页的管理员数据
 */
export const findallmanager = query => {
    return request({
        url: '/FindAllAdmin',
        method: 'post',
        params: query
    })
}
/**
 * 添加管理员
 */
export const addmanager = (data) => {
    return request({
        url: '/AddAdmin',
        headers: {
            'Content-Type': 'multipart/form-data'
        },
        method: 'post',
        // params: query,
        data: data,
    })
}
/**
 * 删除管理员
 */
export const deletemanager = (data) => {
    return request({
        url: '/DeleteAdmin',
        method: 'post',
        params: data,
        // data: data
    })
}

// 统计班级信息
// 学员地址
export const CountStuByadress = query => {
    return request({
        url: '/CountStuByadress',
        method: 'post',
        params: query,
    })
}
// 学员性别
export const CountStudentBysex = query => {
    return request({
        url: '/CountStudentBysex',
        method: 'post',
        params: query,
    })
}

// 修改管理员密码
export const updatepassword = query => {
    return request({
        url: '/UpdatePassword',
        method: 'post',
        params: query,
    })
}
// 修改头像
export const UpdateLogo = data => {
    return request({
        url: '/UpdateLogo',
        headers: {
            'Content-Type': 'multipart/form-data'
        },
        method: 'post',
        data: data,
    })
}